<template>
  
  <div class="box">
      <div class="toubu">
          <Header />
      </div>
    
    
    <div class="swipe1">
        <Swipe/>
    </div>
    
    <div class="tuijian">
            <div>
                <h2>品质套餐</h2>
                <p>搭配齐全吃得好</p>
                <a href="#">立即抢购 ></a>
            </div>
            <div>
                <img src="https://cube.elemecdn.com/e/ee/df43e7e53f6e1346c3fda0609f1d3png.png?x-oss-process=image/resize,w_282,h_188,m_fixed">
            </div>
        </div>
        <div class="huiyuan">
            <div>
                <p class="iconfont" style="color:rgb(199, 146, 47);font-size: 14px;">&#xe61a;</p>
                <h2>超级会员 </h2>
                <p class="qi">· 每月领20元红包</p>
            </div>
            <div>
                <p class="iconfont">立即开通 &#xe601;</p>
            </div>
        </div>
    
    <!-- <h1 v-if="di.latitude">{{di.latitude}}</h1> -->
    <div class="fujin">
       <footer>
      <div class="head">
            <p></p>
            <div>推荐商家</div>
            <p></p>
      </div>
       <nav>
            <ul>
                <li>
                    <p class="iconfont">综合排序 &#xe627;
                        
                    </p>
                </li>
                <li>
                    距离最近
                </li>
                <li>销量最高</li>
                <li>
                    <p class="iconfont">筛选 &#xe6a6;</p>
                </li>
            </ul>
        </nav>
        <div class="content">
           <div v-for="item,i in fushang" :key='i' @click="xiang(item.id)">
                <section>
                    <div>
                        <img alt="全国美食(市区八一路店)" class="logo-logo_3S1eSkn_0" :src="'/myE/img/'+item.image_path">
                        <div class="px">
                            <div class="pin">
                                <p>品牌</p>
                                <h2 :title="item.name">{{item.name}}</h2>
                            </div>
                            <van-rate v-model="item.rating" allow-half void-icon="star" void-color="#eee" />
                            <!-- <p class="iconfont">5月售32单</p> -->
                            <p>￥{{item.float_minimum_order_amount}}起送 | {{item.piecewise_agent_fee.tips}}</p>
                            <i class="hj">{{item.category}}</i>
                        </div>

                    </div>

                    <div class="zhuan">
                        <p class="iconfont">&#xe637;</p>
                        <p>蜂鸟专送</p>
                        <p>{{item.distance}} | {{item.order_lead_time}}</p>
                    </div>
                </section>
                <section class="zi">
                    <div>
                        <p title="满19元减4元，满28元减6元，满48元减10元"><span>减</span>满19元减4元，满28元减6元，满48元减10元</p>
                        <p><span>配</span>配送费立减4元</p>

                    </div>
                    <div class="heng">
                        <p>6个活动 </p>
                        <p class="sj"></p>
                    </div>


                </section>
                <div class="line"></div>
            </div>
        </div>
    </footer>
    </div>
     
    <aside v-show="!login1">
        <p>登录可领取海量权益</p>
        <button @click="login">马上登录</button>
    </aside>
    
   
  </div>
</template>

<script>
// @ is an alias to /src
import Header from "../components/header";
import Swipe from '../components/swipe';

import { ajax_shopLie, ajax_jinShop } from "../ajax/index";
import {mapState} from 'vuex'

export default {
  name: "",
  data() {
    return {
      fujin: [],
      fushang:[],
    };
  },
  methods:{
   login(){
       this.$router.push('/login')
   },
   xiang(id){
       this.$router.push("/xianQin?id="+id)
   }
  },
  computed: {
      ...mapState(['di','login1']),
      
  },
  created() {
  },
  mounted(){
      
console.log(this.login1)
  },
  updated(){
       console.log(this.login1)
  },
  watch:{
    di(value){
      // console.log(1111, value)
      if(value){
        // getShang()
        ajax_jinShop({
          latitude:value.latitude,
          longitude:value.longitude
        }).then(data=>{
          console.log(data);
          this.fushang=data;
          // this.mingzi=data.image_path
        })
      }
    }
  },
  components: {
    Header,
    Swipe,
   
  }
};
</script>

<style scoped>
.box{
    position: relative;
}
.box >>> .van-rate__icon--full{
    color: orange;
}
/* .box >>> .van-rate{
    width: 80px;
} */
aside{
    position: fixed;
    display: flex;
    justify-content: space-between;
    font-family:inherit;
    align-items: center;
    padding:1.8vh 3vw ;
    bottom: 8vh;
    width: 94vw;
    color: white;
    background-color:rgba(0, 0, 0, 0.801);
}
aside>button{
    outline: none;
    border: none;
    color: white;
    border-radius: 4px;
    padding: .6vh 1.6vw;
    background-color: rgb(105, 105, 241);
}
.toubu{
    position: fixed;
    top: 0;
    z-index: 1000;
}
.swipe1{
    margin-top: 7.5vh;
}

@font-face {
  font-family: 'iconfont';  /* project id 2408325 */
  src: url('//at.alicdn.com/t/font_2408325_l6sx94jz8ke.eot');
  src: url('//at.alicdn.com/t/font_2408325_l6sx94jz8ke.eot?#iefix') format('embedded-opentype'),
  url('//at.alicdn.com/t/font_2408325_l6sx94jz8ke.woff2') format('woff2'),
  url('//at.alicdn.com/t/font_2408325_l6sx94jz8ke.woff') format('woff'),
  url('//at.alicdn.com/t/font_2408325_l6sx94jz8ke.ttf') format('truetype'),
  url('//at.alicdn.com/t/font_2408325_l6sx94jz8ke.svg#iconfont') format('svg');
}
/* .box{
  background-color: white;
} */
.fujin {
  width: 100vw;
  margin-top: 15px;
  background-color: #f5f5f5;
}

.fujin>p{
  margin: 0 10px;
  padding:10px 0;
  background-color: white;
  text-indent: 10px;
  border-radius: 10px;
}
.fujin>div{
  width: calc(100vw - 20px);
  height: 26vh;
  border-bottom: 1px solid rgb(202, 201, 201);
  display: flex;
  /* padding: 10px 0; */
  margin: 10px;
  border-radius: 10px;
  background-color: white;
}
.fujin img{
  width: 18vw;
  height: 18vw;
}
.tuijian {
    width: 96vw;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    border-radius: 6px;
    background-color: rgb(253, 253, 253);
}

.tuijian>div {
    margin: 15px 10px 0 15px;
}

.tuijian img {
    width: 34vw;
}

.tuijian h2 {
    /* display: block; */
    font-size: 16px;
    padding: 3px 0;
}

.tuijian p {
    font-size: 12px;
    padding: 3px 0;
}

.tuijian>div>a {
    color: orange;
}

.huiyuan {
    width: 96vw;
    margin: 5px auto;
    background-image: linear-gradient(90deg, #ffefc4, #f3dda0);
    display: flex;
    justify-content: space-between;
    /* align-items: flex-end; */
    padding: 8px 0;
}

.huiyuan>div:nth-of-type(1) {
    margin-left: 10px;
    display: flex;
}

.huiyuan>div:nth-of-type(1) h2 {
    font-size: 13px;
    color: gray;
    margin-left: 5px;
}

.huiyuan>div:nth-of-type(1) .qi {
    font-size: 10px;
    color: gray;
    margin-top: 2px;
    margin-left: 5px;
}

.huiyuan>div:nth-of-type(2) {
    margin-right: 10px;
}

.huiyuan>div:nth-of-type(2) p {
    font-size: 10px;
    color: black;
    margin-top: 2px;
}
.fujin{
  width: 100vw;
  background-color: white;
}
footer {
    width: 94vw;
    margin: 0 auto;
    /* background-color: white; */
}

footer .head {
    width: 34vw;
    margin: 10px auto;
    padding-top: 10px;
    display: flex;
    justify-content: space-between;
}

footer .head div {
    font-weight: normal;
    font-size: 15px;
    /* border-top: 1px solid gray; */
}

footer .head p {
    width: 5vw;
    border-top: 1px solid gray;
    margin-top: 8px;
}

footer nav {
    width: 92vw;
    height: 7vh;
    padding: 0 4vw;
    margin-left: -4vw;
    line-height: 7vh;
    /* margin: 20px auto; */
}

footer nav>ul {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: rgb(104, 104, 104);
}

footer nav>ul li:nth-of-type(1) {
    display: flex;
}

.sj {
    width: 0px;
    height: 0px;
    border: 4px solid;
    border-color: transparent transparent rgb(134, 133, 133) transparent;
    transform: rotate(180deg);
    margin: 17px 0 0 5px;
}

.content section:nth-of-type(1) {
    display: flex;
    justify-content: space-between;
    margin-top: 4vh;
}

.content section:nth-of-type(1)>div:nth-of-type(1) {
    width: 50vw;
    display: flex;
    justify-content: space-between;
}

.content section:nth-of-type(1)>div:nth-of-type(1) img {
    width: 18vw;
    height: 18vw;
}

.content .zhuan {
    width: 38vw;
    display: flex;
    flex-wrap: wrap;
    justify-content: end;
    height: 10vh;
    align-content: space-between;
}

.zhuan>p {

    font-size: 12px;
    color: rgb(131, 130, 130);
}

.zhuan>p:nth-of-type(1) {
    width: 25vw;
    text-align: end;
}

.zhuan>p:nth-of-type(2) {
    color: white;
    padding: 1px 3px;
    background-color: rgb(95, 95, 218);
}

.pin {
    display: flex;
    margin-bottom: 4px;
}

.pin>p {
    font-size: 10px;
    width: 28px;
    height: 15px;
    line-height: 15px;
    background-color: yellow;
    text-align: center;
    margin-right: 5px;
    margin-top: 1px;
}

.pin h2 {
    font-size: 14px;
}
.px{
    margin-left: 2vw;
}
.px h2{
    width: 18vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

}
.px>p {
    font-size: 12px;
    color: #666;
    font-family: 'Helvetica Neue', Tahoma, Arial, PingFangSC-Regular, 'Hiragino Sans GB', 'Microsoft Yahei', sans-serif;
    padding: 3px 0;
}

.hj {
    /* width: 15vw; */
    padding: 0;
    margin: 0;
    font-style: normal;
    font-size: 12px;
    text-align: center;
    background-color: aliceblue;
    box-shadow: 1px 1px 1px gray;
}

.zi {
    margin-top: 3vh;
    margin-left: 20vw;
    display: flex;
    margin-bottom: 3vh;
    justify-content: space-between;
}

.zi p {
    font-size: 10px;
    color: gray;
    padding: 3px 0;
    cursor: pointer;
}

.zi>div:nth-of-type(1)>p:nth-of-type(1) {
    width: 58vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.zi>div>p span {
    color: white;
    border-radius: 2px;
    padding: 0 2px;
    margin-right: 4px;
}

.zi>div>p:nth-of-type(1) span {
    background-color: red;
}

.zi>div>p:nth-of-type(2) span {
    background-color: green;
}

.heng {
    display: flex;
}

.heng .sj {
    margin: 0;
    margin-top: 6px;
    margin-left: 3px;
}

.line {
    width: 92vw;
    margin-left: -4vw;
    padding: 0 4vw;
    border-bottom: 1px solid rgb(201, 200, 200);
}

</style>
